
public class ProgAppsProjectMeasurements{
	public static void main(String[] args){
		String tmp;

		while(true){
			tmp = ("Temperature Converter Menu\n\n");
			tmp += ("1.Minute to Second\n");
			tmp += ("2.Second to Minute\n");
			tmp += ("3.Hour to Minute\n");
			tmp += ("4.Minute to Hour\n");
			tmp += ("5.Second to Hour\n");
			tmp += ("6.Hour to Second\n");
			tmp += ("7.Kilometer to Meter\n");
			tmp += ("8.Meter to Kilometer\n");
		    tmp += ("9.Kilometer to Milimeter\n");
		    tmp += ("10.Milimeter to Kilometer\n");
		    tmp += ("11.Centimeter to Kilometer\n");
		    tmp += ("12.Kilometer to Centimeter\n");
		    tmp += ("13.Milimeter to Centimeter\n");
		    tmp += ("14.Centimeter to Milimeter\n");
		    tmp += ("15.Meter to Centimeter\n");
		    tmp += ("16.Centimeter to Meter\n");
		    tmp += ("17.Liter to Mililiter\n");
		    tmp += ("18.Mililiter to Liter\n");
		    tmp += ("19.Centiliter to Meliliter\n");
		    tmp += ("20.Meliliter to Centiliter\n");
		    tmp += ("21.Liter to Centiliter\n");
		    tmp += ("22.Centiliter to Liter\n");
			tmp += ("23.Quit\n");
			tmp += ("Please Enter Your Choice!");
			int choice = Integer.parseInt(input(tmp));

			switch(choice){
			case 1:
					doMinuteSecond();
					break;
			case 2:
					doSecondMinute();
					break;

			case 3:
					doHourMinute();
					break;

			case 4:
					doMinuteHour();
					break;

			case 5:
					doSecondHour();
					break;

			case 6:
					doHourSecond();
					break;

			case 7:
					doKMtoM();
					break;

			case 8:
					doMtoKM();
					break;

			case 9:
					doKMtoMM();
					break;

			case 10:
					doMMtoKM();
					break;

			case 11:
					doCMtoKM();
					break;

			case 12:
					doKMtoCM();
					break;

			case 13:
					doMMtoCM();
					break;

			case 14:
					doCMtoMM();
					break;

			case 15:
					doMtoCM();
					break;

			case 16:
					doCMtoM();
					break;

			case 17:
					doMLtoL();
					break;

			case 18:
					doLtoML();
					break;

			case 19:
					doCLtoML();
					break;

			case 20:
					doMLtoCL();
					break;

			case 21:
					doLtoCL();
					break;

			case 22:
					doCLtoL();
					break;

			case 23:
				 	System.exit(0);
					break;
			default:
					print("invalid choice");
					break;
				}
			}
		}
		static String s;
		
		
		public static void doMinuteSecond(){
		s = ("please enter your time in Minute");
		double minute = Double.parseDouble(input(s));
		double second = minute*60;
		print(minute + " minute/s =" + second + " second/s");
		}

		public static void doSecondMinute(){
		s = ("please enter your time in Second");
		double second = Double.parseDouble(input(s));
		double minute = second/60;
		print(minute + " minute/s =" + second + " second/s");
		}

		public static void doHourMinute(){
		 
		s = ("please enter your time in Hour");
		double hour = Double.parseDouble(input(s));
		double minute = hour*60;
		print(hour + " hour/s =" + minute + " minute/s");
		}

		public static void doMinuteHour(){
		 
	    s = ("please enter your time in Minute");
		double minute = Double.parseDouble(input(s));
		double hour = minute/60;
		print(minute+ " minute/s =" + hour + " hour/s");
		}

		public static void doSecondHour(){
		 
		s = ("please enter your time in Second");
		double second = Double.parseDouble(input(s));
		double hour = second/3600;
		print(second+ " second/s =" + hour + " hour/s");
		}

		public static void doHourSecond(){
		 
		s = ("please enter your time in Second");
		double second = Double.parseDouble(input(s));
		double hour = second/3600;
		print(second+ " second/s =" + hour + " hour/s");
		}

		public static void doKMtoM(){
		 
		s = ("please enter your length in km");
		double km = Double.parseDouble(input(s));
		double m = km*100;
		print(km + "km =" + m + "m");
		}

		public static void doMtoKM(){
		 
		s = ("please enter your length in m");
		double m = Double.parseDouble(input(s));
		double km = m/100;
		print(m + "m =" + km + "km");
		}

		public static void doKMtoMM(){
		 
	    s = ("please enter your length in km");
		double km = Double.parseDouble(input(s));
		double mm = km*1000000;
		print(km + "km =" + mm + "mm");
		}

		public static void doMMtoKM(){
		 
	    s = ("please enter your length in mm");
		double mm = Double.parseDouble(input(s));
		double km = mm/1000000;
		print(mm + "mm =" + km + "km");
		}

		public static void doCMtoKM(){
		 
		s = ("please enter your length in cm");
		double cm = Double.parseDouble(input(s));
		double km = cm/1000;
		print(cm + "cm =" + km + "km");
		}

		public static void doKMtoCM(){
		 
		s = ("please enter your length in km");
		double km = Double.parseDouble(input(s));
		double cm = km*1000;
		print(km + "km =" + cm + "cm");
		}

		public static void doMMtoCM(){
		 
		s = ("please enter your length in mm");
		double mm = Double.parseDouble(input(s));
		double cm = mm/10;
		print(mm + "mm =" + cm + "cm");
		}

		public static void doCMtoMM(){
		 
		s = ("please enter your length in cm");
		double cm = Double.parseDouble(input(s));
		double mm = cm*10;
		print(cm + "cm =" + mm + "mm");
		}

		public static void doMtoCM(){
		 
		s = ("please enter your length in m");
		double m = Double.parseDouble(input(s));
		double cm = m*10;
		print(m + "m =" + cm + "cm");
		}

		public static void doCMtoM(){
		 
		s = ("please enter your length in m");
		double cm = Double.parseDouble(input(s));
		double m = cm/10;
		print(cm + "cm =" + m + "m");
		}

		public static void doMLtoL(){
		 
		s = ("please enter your length in ml");
		double ml = Double.parseDouble(input(s));
		double l = ml/100;
		print(ml + "ml =" + l + "l");
		}

		public static void doLtoML(){
		 
		s = ("please enter your length in l");
		double l = Double.parseDouble(input(s));
		double ml = l/100;
		print(l + "l =" + ml + "ml");
		}

		public static void doLtoCL(){
		 
		s = ("please enter your length in l");
		double l = Double.parseDouble(input(s));
		double cl = l*10;
		print(l + "l =" + cl + "cl");
		}

		public static void doCLtoL(){
		 
		s = ("please enter your length in l");
		double cl = Double.parseDouble(input(s));
		double l = cl*100;
		print(cl + "cl =" + l + "l");
		}

		public static void doCLtoML(){
		 
		s = ("please enter your length in l");
		double cl = Double.parseDouble(input(s));
		double ml = cl/1;
		print(cl + "cl =" + ml + "ml");
		}

		public static void doMLtoCL(){
		 
		s = ("please enter your length in ml");
		double ml = Double.parseDouble(input(s));
		double cl = ml/1;
		print(ml + "ml =" + cl + "cl");
		}

		private static void print(String string) {
			javax.swing.JOptionPane.showMessageDialog(null, string);			
		}
		
		private static String input(String string) {
			return javax.swing.JOptionPane.showInputDialog(string);
		}




	}